<template>
  <div class="image-info" v-if="Object.keys(imageInfo).length !== 0">
    <div class="info-desc clear-fix">
      <div class="start"></div>
      <div class="desc">{{imageInfo.desc}}</div>
      <div class="end"></div>
    </div>
    <div :key="index" v-for="(item, index) in imageInfo.detailImage">
      <div class="info-key">{{item.key}}</div>
      <div class="info-list">
        <img :key="imgIndex" 
             :src="img" 
             v-for="(img, imgIndex) in item.list"
             @load="detailImgLoad" 
             alt="">
      </div> 
    </div>
  </div>
</template>

<script>
export default {
  props: {
    imageInfo: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  methods: {
    detailImgLoad() {
      this.$emit('detailImgLoad');
    }
  }
}
</script>

<style scoped>
.image-info {
  padding: 20px 0;
  border-bottom: 5px solid #f2f5f8;
}

.info-desc {
  padding: 0 15px;
}

.info-desc .start {
  float: left;
}

.info-desc .end {
  float: right;
}

.info-desc .start,
.info-desc .end {
  position: relative;
  width: 90px;
  height: 2px;
  transform: scale(1, 0.5);
  background-color: #a3a3a5;
}

.info-desc .start::before,
.info-desc .end::after {
  position: absolute;
  bottom: 0;
  content: "";
  width: 5px;
  height: 10px;
  background-color: #333;
}

.info-desc .end::after {
  right: 0;
}

.info-desc .desc {
  font-size: 14px;
  padding: 15px 0;
}

.info-key {
  padding: 10px 15px;
  font-size: 15px;
  color: #333;
}

.info-list img {
  width: 100%;
}
</style>